/*
 *  This file is part of the SIRIUS libraries for analyzing MS and MS/MS data
 *
 *  Copyright (C) 2024 Bright Giant GmbH
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Lesser General Public
 *  License as published by the Free Software Foundation; either
 *  version 2.1 of the License, or (at your option) any later version.
 *
 *  This library is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *  Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along with SIRIUS.  If not, see <http://www.gnu.org/licenses/>.
 *
 *  NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 *  https://openapi-generator.tech
 *  Do not edit the class manually.
 */


package io.sirius.ms.sdk.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import io.sirius.ms.sdk.model.CompoundClassType;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * Predicted compound class with name, probability and id if available.  (ClassyFire and NPC). This can be seen as the set of classes a feature most likely belongs to
 */
@JsonPropertyOrder({
  CompoundClass.JSON_PROPERTY_TYPE,
  CompoundClass.JSON_PROPERTY_LEVEL,
  CompoundClass.JSON_PROPERTY_LEVEL_INDEX,
  CompoundClass.JSON_PROPERTY_NAME,
  CompoundClass.JSON_PROPERTY_DESCRIPTION,
  CompoundClass.JSON_PROPERTY_ID,
  CompoundClass.JSON_PROPERTY_PROBABILITY,
  CompoundClass.JSON_PROPERTY_INDEX,
  CompoundClass.JSON_PROPERTY_PARENT_ID,
  CompoundClass.JSON_PROPERTY_PARENT_NAME
})
@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.14.0")
public class CompoundClass {
  public static final String JSON_PROPERTY_TYPE = "type";
  @jakarta.annotation.Nullable
  private CompoundClassType type;

  public static final String JSON_PROPERTY_LEVEL = "level";
  @jakarta.annotation.Nullable
  private String level;

  public static final String JSON_PROPERTY_LEVEL_INDEX = "levelIndex";
  @jakarta.annotation.Nullable
  private Integer levelIndex;

  public static final String JSON_PROPERTY_NAME = "name";
  @jakarta.annotation.Nullable
  private String name;

  public static final String JSON_PROPERTY_DESCRIPTION = "description";
  @jakarta.annotation.Nullable
  private String description;

  public static final String JSON_PROPERTY_ID = "id";
  @jakarta.annotation.Nullable
  private Integer id;

  public static final String JSON_PROPERTY_PROBABILITY = "probability";
  @jakarta.annotation.Nullable
  private Double probability;

  public static final String JSON_PROPERTY_INDEX = "index";
  @jakarta.annotation.Nullable
  private Integer index;

  public static final String JSON_PROPERTY_PARENT_ID = "parentId";
  @jakarta.annotation.Nullable
  private Integer parentId;

  public static final String JSON_PROPERTY_PARENT_NAME = "parentName";
  @jakarta.annotation.Nullable
  private String parentName;

  public CompoundClass() {
  }

  public CompoundClass type(@jakarta.annotation.Nullable CompoundClassType type) {
    
    this.type = type;
    return this;
  }

  /**
   * Get type
   * @return type
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_TYPE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public CompoundClassType getType() {
    return type;
  }


  @JsonProperty(JSON_PROPERTY_TYPE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setType(@jakarta.annotation.Nullable CompoundClassType type) {
    this.type = type;
  }

  public CompoundClass level(@jakarta.annotation.Nullable String level) {
    
    this.level = level;
    return this;
  }

  /**
   * Name of the level this compound class belongs to
   * @return level
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_LEVEL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getLevel() {
    return level;
  }


  @JsonProperty(JSON_PROPERTY_LEVEL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setLevel(@jakarta.annotation.Nullable String level) {
    this.level = level;
  }

  public CompoundClass levelIndex(@jakarta.annotation.Nullable Integer levelIndex) {
    
    this.levelIndex = levelIndex;
    return this;
  }

  /**
   * Index of the level this compound class belongs to
   * @return levelIndex
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_LEVEL_INDEX)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getLevelIndex() {
    return levelIndex;
  }


  @JsonProperty(JSON_PROPERTY_LEVEL_INDEX)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setLevelIndex(@jakarta.annotation.Nullable Integer levelIndex) {
    this.levelIndex = levelIndex;
  }

  public CompoundClass name(@jakarta.annotation.Nullable String name) {
    
    this.name = name;
    return this;
  }

  /**
   * Name of the compound class.
   * @return name
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getName() {
    return name;
  }


  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setName(@jakarta.annotation.Nullable String name) {
    this.name = name;
  }

  public CompoundClass description(@jakarta.annotation.Nullable String description) {
    
    this.description = description;
    return this;
  }

  /**
   * Description of the compound class.
   * @return description
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_DESCRIPTION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getDescription() {
    return description;
  }


  @JsonProperty(JSON_PROPERTY_DESCRIPTION)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setDescription(@jakarta.annotation.Nullable String description) {
    this.description = description;
  }

  public CompoundClass id(@jakarta.annotation.Nullable Integer id) {
    
    this.id = id;
    return this;
  }

  /**
   * Unique id of the class. Might be undefined for certain classification ontologies.
   * @return id
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getId() {
    return id;
  }


  @JsonProperty(JSON_PROPERTY_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setId(@jakarta.annotation.Nullable Integer id) {
    this.id = id;
  }

  public CompoundClass probability(@jakarta.annotation.Nullable Double probability) {
    
    this.probability = probability;
    return this;
  }

  /**
   * prediction probability
   * @return probability
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PROBABILITY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Double getProbability() {
    return probability;
  }


  @JsonProperty(JSON_PROPERTY_PROBABILITY)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setProbability(@jakarta.annotation.Nullable Double probability) {
    this.probability = probability;
  }

  public CompoundClass index(@jakarta.annotation.Nullable Integer index) {
    
    this.index = index;
    return this;
  }

  /**
   * Absolute index of this property in the predicted vector/embedding
   * @return index
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_INDEX)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getIndex() {
    return index;
  }


  @JsonProperty(JSON_PROPERTY_INDEX)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setIndex(@jakarta.annotation.Nullable Integer index) {
    this.index = index;
  }

  public CompoundClass parentId(@jakarta.annotation.Nullable Integer parentId) {
    
    this.parentId = parentId;
    return this;
  }

  /**
   * Unique id of the parent class. Might be undefined for certain classification ontologies.
   * @return parentId
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PARENT_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getParentId() {
    return parentId;
  }


  @JsonProperty(JSON_PROPERTY_PARENT_ID)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setParentId(@jakarta.annotation.Nullable Integer parentId) {
    this.parentId = parentId;
  }

  public CompoundClass parentName(@jakarta.annotation.Nullable String parentName) {
    
    this.parentName = parentName;
    return this;
  }

  /**
   * Name of the parent compound class.
   * @return parentName
   */
  @jakarta.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PARENT_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getParentName() {
    return parentName;
  }


  @JsonProperty(JSON_PROPERTY_PARENT_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setParentName(@jakarta.annotation.Nullable String parentName) {
    this.parentName = parentName;
  }


  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CompoundClass compoundClass = (CompoundClass) o;
    return Objects.equals(this.type, compoundClass.type) &&
        Objects.equals(this.level, compoundClass.level) &&
        Objects.equals(this.levelIndex, compoundClass.levelIndex) &&
        Objects.equals(this.name, compoundClass.name) &&
        Objects.equals(this.description, compoundClass.description) &&
        Objects.equals(this.id, compoundClass.id) &&
        Objects.equals(this.probability, compoundClass.probability) &&
        Objects.equals(this.index, compoundClass.index) &&
        Objects.equals(this.parentId, compoundClass.parentId) &&
        Objects.equals(this.parentName, compoundClass.parentName);
  }

  @Override
  public int hashCode() {
    return Objects.hash(type, level, levelIndex, name, description, id, probability, index, parentId, parentName);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CompoundClass {\n");
    sb.append("    type: ").append(toIndentedString(type)).append("\n");
    sb.append("    level: ").append(toIndentedString(level)).append("\n");
    sb.append("    levelIndex: ").append(toIndentedString(levelIndex)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    description: ").append(toIndentedString(description)).append("\n");
    sb.append("    id: ").append(toIndentedString(id)).append("\n");
    sb.append("    probability: ").append(toIndentedString(probability)).append("\n");
    sb.append("    index: ").append(toIndentedString(index)).append("\n");
    sb.append("    parentId: ").append(toIndentedString(parentId)).append("\n");
    sb.append("    parentName: ").append(toIndentedString(parentName)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}

